//
//  CLHViewControllerViewModel.m
//  ListViewModel_Example
//
//  Created by 曹连华 on 2019/7/30.
//  Copyright © 2019 clh2046@163.com. All rights reserved.
//

#import "CLHViewControllerViewModel.h"

@implementation CLHViewControllerViewModel

- (void)resetDataSource {
    [self.dataSource resetRowListInSection:[self rows]];
}



- (void)didSelectedRowModelWithIndexPath:(NSIndexPath *)indexPath {
    LVBaseCellRowModel *rowModel = [self.dataSource rowModelAtIndex:indexPath];
    NSLog(@"点击了 section = %ld %@",(long)indexPath.section,rowModel.mainTitle);
}


- (NSArray <LVBaseCellRowModel *> *)rows {
    LVBaseCellRowModel *row0 = [[LVBaseCellRowModel alloc]initWithCellClass:@"CLHBaseTVCell"];
    row0.mainTitle = @"TableView";
    row0.rowHeight = 50;
    
    LVBaseCellRowModel *row1 = [[LVBaseCellRowModel alloc]initWithCellClass:@"CLHBaseTVCell"];
    row1.mainTitle = @"CollectionView";
    row1.rowHeight = 50;
    
    LVBaseCellRowModel *row2 = [[LVBaseCellRowModel alloc]initWithCellClass:@"CLHBaseTVCell"];
    row2.mainTitle = @"SwiftCode";
    row2.rowHeight = 50;
    
    return @[row0,row1,row2];
}

@end
